package com.yyfax.pay.common.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 富友银行卡类型枚举
 * 
 * @author buyi
 * @date 2017-05-27 11:05:30
 * @since v1.1.0
 */
public enum FuiouCardTypeEnum {

	DEBIT("01", "借记卡");

	private String value;
	private String remark;

	private FuiouCardTypeEnum(String value, String remark) {
		this.value = value;
		this.remark = remark;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public static boolean isValue(String value) {
		if (StringUtils.isBlank(value)) {
			return false;
		}

		for (FuiouCardTypeEnum paymentEnum : FuiouCardTypeEnum.values()) {
			if (StringUtils.equals(paymentEnum.getValue(), value)) {
				return true;
			}
		}

		return false;
	}

	public static FuiouCardTypeEnum fromValue(String value) {
		if (StringUtils.isBlank(value)) {
			return null;
		}

		for (FuiouCardTypeEnum paymentEnum : FuiouCardTypeEnum.values()) {
			if (StringUtils.equals(paymentEnum.getValue(), value)) {
				return paymentEnum;
			}
		}

		return null;
	}
}
